<?php
/* @var $this TbauctionitemController */
/* @var $model Tbauctionitem */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'tbauctionitem-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
	'htmlOptions'	=>	array(
		"enctype"=>"multipart/form-data",
	)
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>
	
    Select Auction
	<?php if (isset($_GET['aid']) && $_GET['aid'] != ""){ ?>
		<input type="hidden" name="aid" value="<?php echo $_GET['aid']; ?>" />
	<?php } else { ?>
		<select name="aid">
			<?php foreach($auctions as $data): ?>
				<option value="<?php echo $data->id; ?>"><?php echo $data->id; ?> | <?php echo $data->nameOfEstate; ?> | <?php echo $data->cahiID; ?></option>
			<?php endforeach; ?>
		</select>
	<?php }?>

	<div class="row">
		<?php echo $form->labelEx($model,'address'); ?>
		<?php echo $form->textField($model,'address',array('size'=>60,'maxlength'=>250)); ?>
		<?php echo $form->error($model,'address'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'gpsCoordinates'); ?>
		<?php echo $form->textField($model,'gpsCoordinates',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'gpsCoordinates'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'propertyDescription'); ?>
		<?php echo $form->textArea($model,'propertyDescription',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'propertyDescription'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'propertySize'); ?>
		<?php echo $form->textField($model,'propertySize',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'propertySize'); ?>
	</div>

	<div class="row" hidden="true">
		<?php echo $form->labelEx($model,'dateTimeModified'); ?>
		<?php echo $form->textField($model,'dateTimeModified', array('value' => date('Y-m-d H:i:s'), 'readonly' => 'true')); ?>
		<?php echo $form->error($model,'dateTimeModified'); ?>
	</div>

	<div class="row" hidden="true">
		<?php echo $form->labelEx($model,'modifiedUser'); ?>
		<?php echo $form->textField($model,'modifiedUser', array('value' => Yii::app()->user->name, 'readonly' => 'true')); ?>
		<?php echo $form->error($model,'modifiedUser'); ?>
	</div>

	<div class="row" hidden="true">
		<?php echo $form->labelEx($model,'status'); ?>
		<?php echo $form->textField($model,'status', array('value'=>'2', 'readonly' => 'true')); ?>
		<?php echo $form->error($model,'status'); ?>
	</div>
    
	<div class="row" hidden="true">
		<?php echo $form->labelEx($model,'active'); ?>
		<?php echo $form->textField($model,'active', array('value'=>'1', 'readonly' => 'true')); ?>
		<?php echo $form->error($model,'active'); ?>
	</div>
    
    <div class="row">
		<?php echo $form->labelEx($model,'filePropertyInspection'); ?>
		<?php echo $form->fileField($model,'filePropertyInspection', array('value'=>'1', 'readonly' => 'true')); ?>
		<?php echo $form->error($model,'filePropertyInspection'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->